#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTimer>
#include <QMouseEvent>
#include <QPushButton>

using namespace std;

namespace Ui {
class Widget;
}
struct Point
{
    QPoint point;
    int alpha;

    Point(const QPoint &p, int a) : point(p) , alpha(a) { }
};

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();
    QPushButton *btn[12];

protected:
    //virtual void changeEvent(QEvent *e);
    virtual bool eventFilter(QObject *watched, QEvent *e);
    void paintOnWidget(QWidget *w);
    void gradientArc(QPainter *painter, int radius, int startAngle, int angleLength, int arcHeight, QRgb color);
    void mouseMoveEvent(QMouseEvent *event);

private slots:
    void on_timer();
    void on_Btn_close_clicked();
    void on_Btn_key_clicked();
    void on_Btn_pic_clicked();
    void on_Btn_saomiao_clicked();   
    void btnclick();

    void on_btn_del_clicked();

    void on_btn_clear_clicked();

    void on_btn_ok_clicked();

private:
    Ui::Widget *ui;
    QTimer *timer;
    QTimer *timer_pic;
    int rotate = 0;
    int m_angle = 0;
    QList<Point> m_points;
    char* images[5] = {":/images/1.jpg",":/images/2.jpg",":/images/3.jpg",":/images/4.jpg",":/images/5.jpg"};
    int index = -1;
    int frame_y = -110;
    int slide_y = 0;
    int old_y = 0;
};

#endif // WIDGET_H
